<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>认购商品管理</title>
	<meta name="decorator" content="ani"/>
	<script type="text/javascript">

		$(document).ready(function() {
			jp.ajaxForm("#inputForm",function(data){
				if(data.success){
				    jp.success(data.msg);
					jp.go("${ctx}/subgoods/subGoods");
				}else{
				    jp.error(data.msg);
				    $("#inputForm").find("button:submit").button("reset");
				}
			});

		});
	</script>
	<script src="${ctxStatic}/plugin/jquery-1.8.3.min.js"></script><!-- jQuery is required -->
	<script src="${ctxStatic}/plugin/city-picker/js/city-picker.data.js"></script>
	<script src="${ctxStatic}/plugin/city-picker/js/city-picker.js"></script>
	<link rel="stylesheet" type="text/css" href="${ctxStatic}/plugin/city-picker/css/city-picker.css"/>
	<%@ include file="/webpage/include/bootstraptable.jsp"%>
	<%@include file="/webpage/include/treeview.jsp" %>
	<%@include file="subGoodsList.js" %>
</head>
<body>
<div class="wrapper wrapper-content">				
<div class="row">
	<div class="col-md-12">
	<div class="panel panel-primary">
		<div class="panel-heading">
			<h3 class="panel-title"> 
				<a class="panelButton" href="${ctx}/subgoods/subGoods"><i class="ti-angle-left"></i> 返回</a>
			</h3>
		</div>
		<div class="panel-body">
		<form:form id="inputForm" modelAttribute="subGoods" action="${ctx}/subgoods/subGoods/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>商品名称：</label>
					<div class="col-sm-10">
						<form:input path="goodsName" htmlEscape="false"    class="form-control required"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>主图：</label>
					<div class="col-sm-10">
						<sys:fileUpload path="goodsPic"  value="${subGoods.goodsPic}" type="image" uploadPath="/subgoods/subGoods"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">详情图：</label>
					<div class="col-sm-10">
						<sys:fileUpload path="goodsImgs"  value="${subGoods.goodsImgs}" type="image" uploadPath="/subgoods/subGoods"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>单价：</label>
					<div class="col-sm-10">
						<form:input path="price" htmlEscape="false"    class="form-control required isFloatGtZero"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">数量：</label>
					<div class="col-sm-10">
						<form:input path="num" htmlEscape="false"    class="form-control required isIntGteZero"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">展示数量：</label>
					<div class="col-sm-10">
						<form:input path="origianNum" htmlEscape="false"    class="form-control required isIntGteZero"/>
					</div>
				</div>

				<div class="form-group">
					<label class="col-sm-2 control-label">库存：</label>
					<div class="col-sm-10">
						<form:input path="stock" htmlEscape="false"    class="form-control required isIntGteZero"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">地区：</label>
					<div class="col-sm-10" style="position: relative;">
						<form:input path="position" htmlEscape="false"  data-toggle="city-picker"  class="form-control "/>
					</div>
				</div>
				<%--<div style="position: relative;"><!-- container -->--%>
					<%--<input readonly type="text" data-toggle="city-picker">--%>
				<%--</div>--%>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>认购开始时间：</label>
					<div class="col-sm-10">
						<div class='input-group date' id='startTime' style="" >
							<form:input type='text'  path="startTime" class="form-control"  />
							<span class="input-group-addon">
							   <span class="glyphicon glyphicon-calendar"></span>
						   </span>
						</div>
						<%--<form:input path="startTime" htmlEscape="false"    class="form-control required"/>--%>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>认购结束时间：</label>
					<div class="col-sm-10">
						<div class='input-group date' id='endTime' style="" >
							<form:input type='text'  path="endTime" class="form-control"  />
							<span class="input-group-addon">
							   <span class="glyphicon glyphicon-calendar"></span>
						   </span>
						</div>
						<%--<form:input path="endTime" htmlEscape="false"    class="form-control required"/>--%>
					</div>
				</div>
				<p style="color: red;margin-left: 20px">注：请 选择 或 用英文输入法输入开始结束时间，例：2020-04-01 09:00 或 2020-04-01 14:00</p>
			<div class="form-group">
				<label class="col-sm-2 control-label"><font color="red">*</font>轮数：</label>
				<div class="col-sm-10">
					<form:input path="roundsNumber" htmlEscape="false"    class="form-control required isFloatGtZero"/>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">是否关闭：</label>
				<div class="col-sm-10">
					<form:select path="isSub" class="form-control ">
						<form:option value="" label=""/>
						<form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					</form:select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label">是否可交易：</label>
				<div class="col-sm-10">
					<form:select path="isTrade" class="form-control ">
						<form:option value="" label=""/>
						<form:options items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
					</form:select>
				</div>
			</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">备注：</label>
					<div class="col-sm-10">
						<form:textarea path="remarks" htmlEscape="false" rows="4"    class="form-control "/>
					</div>
				</div>
		<c:if test="${mode == 'add' || mode=='edit'}">
				<div class="col-lg-3"></div>
		        <div class="col-lg-6">
		             <div class="form-group text-center">
		                 <div>
		                     <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="正在提交...">提 交</button>
		                 </div>
		             </div>
		        </div>
		</c:if>
		</form:form>
		</div>				
	</div>
	</div>
</div>
</div>
</body>
</html>